/* __auth__ : KunLin */

package com.cskaoyan.bean.vo.goods;

import lombok.Data;
import lombok.NoArgsConstructor;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

@NoArgsConstructor
@Data
public class HomeIndexVO {

    private Integer errno;
    private DataDTO data;
    private String errmsg;

    @NoArgsConstructor
    @Data
    public static class DataDTO {
        private List<NewGoodsListDTO> newGoodsList;
        private List<CouponDTO> couponList;
        private List<ChannelDTO> channel;
        private List<?> grouponList;
        private List<BannerDTO> banner;
        private List<BrandListDTO> brandList;
        private List<HotGoodsListDTO> hotGoodsList;
        private List<TopicListDTO> topicList;
        private List<FloorGoodsListDTO> floorGoodsList;

        @NoArgsConstructor
        @Data
        public static class NewGoodsListDTO {
            private Integer id;
            private String name;
            private String brief;
            private String picUrl;
            private Boolean isNew;
            private Boolean isHot;
            private BigDecimal counterPrice;
            private BigDecimal retailPrice;
        }

        @NoArgsConstructor
        @Data
        public static class ChannelDTO {
            private Integer id;
            private String name;
            private String iconUrl;
        }

        @NoArgsConstructor
        @Data
        public static class BannerDTO {
            private Integer id;
            private String name;
            private String link;
            private String url;
            private Byte position;
            private String content;
            private Boolean enabled;
            private Date addTime;
            private Date updateTime;
            private Boolean deleted;
        }

        @NoArgsConstructor
        @Data
        public static class BrandListDTO {
            private Integer id;
            private String name;
            private String desc;
            private String picUrl;
            private BigDecimal floorPrice;
        }

        @NoArgsConstructor
        @Data
        public static class HotGoodsListDTO {
            private Integer id;
            private String name;
            private String brief;
            private String picUrl;
            private Boolean isNew;
            private Boolean isHot;
            private BigDecimal counterPrice;
            private BigDecimal retailPrice;
        }

        @NoArgsConstructor
        @Data
        public static class TopicListDTO {
            private Integer id;
            private String title;
            private String subtitle;
            private BigDecimal price;
            private String readCount;
            private String picUrl;
        }

        @NoArgsConstructor
        @Data
        public static class FloorGoodsListDTO {
            private String name;
            private List<GoodsListDTO> goodsList;
            private Integer id;

            @NoArgsConstructor
            @Data
            public static class GoodsListDTO {
                private Integer id;
                private String name;
                private String brief;
                private String picUrl;
                private Boolean isNew;
                private Boolean isHot;
                private BigDecimal counterPrice;
                private BigDecimal retailPrice;
            }
        }

        @Data
        public static class CouponDTO {
            private Integer id;
            private String name;
            private String desc;
            private String tag;
            private Integer total;
            private BigDecimal discount;
            private BigDecimal min;
            private Short limit;
            private Short type;
            private Short status;
            private Short goodsType;
            private Integer[] goodsValue;
            private String code;
            private Short timeType;
            private Short days;
            private Date startTime;
            private Date endTime;
            private Date addTime;
            private Date updateTime;
            private Boolean deleted;
        }
    }

    public HomeIndexVO success(){
        this.setErrmsg("成功");
        this.setErrno(0);
        return this;
    }
}
